﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CorporateGymManagementSystem
{
    internal class Helper
    {
        /// <summary>
        /// open dialog to the user to allow him select csv file
        /// </summary>
        /// <returns>the full path file, return null - if the user canceled</returns>
        public static string SelectCsvFile()
        {
            Microsoft.Win32.SaveFileDialog saveFileDialogCSV = new Microsoft.Win32.SaveFileDialog();
            saveFileDialogCSV.Filter = "CSV (CSV File) (*.csv)|*.csv|";
            saveFileDialogCSV.AddExtension = true;
            saveFileDialogCSV.DefaultExt = ".csv";

            if (saveFileDialogCSV.ShowDialog() == true)
            {
                return saveFileDialogCSV.FileName;
            }

            return null;
        }
    }
}
